const {config,gulp,assetRev} = require("./gulp.config.js") ;
const {src,dest,series, parallel} = gulp;

const moveThird = async () =>{
	return src(config.srcPath + 'third/**/*')
	.pipe(dest(config.prdPath + 'third'))
}
const moveSwiper = async () =>{
	return src(config.srcPath + 'swiper/**/*')
	.pipe(dest(config.prdPath + 'swiper'))
}
const moveJS = async () =>{
	return src(config.srcPath + 'js/**/*')
	.pipe(dest(config.prdPath + 'js'))
}
const moveAudio = async () =>{
	return src(config.srcPath + 'audio/**/*')
	.pipe(dest(config.prdPath + 'audio'))
}
const moveFonts = async () =>{
	return src(config.srcPath + 'fonts/**/*',!config.srcPath + 'fonts/.font-spider/*')
	.pipe(dest(config.prdPath + 'fonts'))
}
const moveAd = async () =>{
	return src(config.srcPath + 'ad/**/*')
	.pipe(dest(config.prdPath + 'ad'))
}
const moveZt = async () =>{
	return src(config.srcPath + 'zt/**/*')
	.pipe(dest(config.prdPath + 'zt'))
}
const moveImg = async () =>{
	return src(config.srcPath + 'images/**/*')
	.pipe(dest(config.prdPath + 'images'))
}

const moveHtml = async () =>{
	console.log("HTML move start")
	return src(config.srcPath + '*.html')
	.pipe(assetRev())
	.pipe(dest(config.prdPath))
}

const moveCss = async () =>{
	return src(config.srcPath + 'css/*.min.css')
		.pipe(dest(config.prdPath + 'css'))
}

exports.build = series(moveHtml, parallel(moveThird,moveSwiper,moveAudio,moveFonts,moveJS,moveAd,moveZt,moveCss,moveImg));

